home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / WIN / VB_DB / PDXBRO.ZIP / MAIN.TXT < prev    next >
Encoding:
Text File  |  1991-07-23  |  4.1 KB  |  188 lines

  1. Dim AlarmTime!
  2. Dim DidRing%
  3. Const appname$ = "pdxbro"
  4.  
  5. Sub Form_Load ()
  6.     DidRing% = FALSE
  7.     AlarmTime! = Timer + 600
  8.     For x = 1 To 6
  9.         inuse%(x) = FALSE
  10.     Next
  11.     If pdoxInit%(appname$, 2) <> TRUE Then
  12.         MsgBox pxerrmsg$(pxerr%), 16, "Engine Init Error"
  13.         If pdoxExit%() <> TRUE Then
  14.             MsgBox pxerrmsg$(pxerr%), 16, "Engine Exit Error"
  15.         End If
  16.         End
  17.     End If
  18.  
  19. End Sub
  20.  
  21. Sub FileOpen_Click ()
  22.     setMousePointer (11)            'place hourglass
  23.     x = 1
  24.     Spec$ = "*.DB"
  25.     fcaption$ = "Pick a Paradox Table"
  26.     ftext$ = "Open a table."
  27.     openOK = FALSE
  28.     For x = 1 To 2      '5
  29.         If inuse%(x) = FALSE Then
  30.             setMousePointer (0)
  31.             tablename$(x) = MhFileSelector2$(Spec$, fcaption$, ftext$)
  32.             If Len(tablename$(x)) Then
  33.                 inuse%(x) = TRUE
  34.                 openOK = TRUE
  35.             Else
  36.                 openOK = FALSE
  37.                 MsgBox "No file selected.", 64, "Open Error"
  38.                 Exit Sub
  39.             End If
  40.             Exit For
  41.         End If
  42.     Next x
  43.     If openOK = FALSE Then
  44.         setMousePointer (0)
  45.         MsgBox "Too many tables open.", 64, "Open Error"
  46.         Exit Sub
  47.     End If
  48.     
  49.  
  50.     Select Case x
  51.         Case 1
  52.             ClearFldForm
  53.             Load Form1
  54.             If Form1.text2.text = "Quit" Then
  55.                 Unload Form1
  56.             End If
  57.  
  58.         Case 2
  59.             ClearFldForm
  60.             Load Form2
  61.             If Form2.text2.text = "Quit" Then
  62.                 Unload Form2
  63.             End If
  64.  
  65.     '    Case 3
  66.     '        ClearFldForm
  67.     '        Load Form3
  68.     '        If Form3.text2.text = "Quit" Then
  69.     '            Unload Form3
  70.     '        End If
  71.     '
  72.     '    Case 4
  73.     '        ClearFldForm
  74.     '        Load Form4
  75.     '        If Form4.text2.text = "Quit" Then
  76.     '            Unload Form4
  77.     '        End If
  78.     '
  79.     '    Case 5
  80.     '        ClearFldForm
  81.     '        Load Form5
  82.     '        If Form5.text2.text = "Quit" Then
  83.     '            Unload Form5
  84.     '        End If
  85.     '
  86.     End Select
  87.  
  88.     Exit Sub
  89.  
  90.  
  91.       
  92. End Sub
  93.  
  94. Sub FileExit_Click ()
  95.     If pdoxExit%() <> TRUE% Then
  96.         MsgBox pxerrmsg$(pxerr%), 16, "Engine Exit Error"
  97.     End If
  98.     End
  99. End Sub
  100.  
  101. Function pdoxInit% (appname$, share%)
  102.     pxerr% = pxwininit%(appname$, share%)
  103.     If pxerr% <> PXSUCCESS% Then
  104.         pdoxInit% = FALSE
  105.     Else
  106.         pdoxInit% = TRUE
  107.     End If
  108. End Function
  109.  
  110. Sub PdoxEng_Click ()
  111.     Dim handle%
  112.     handle% = Shell("PxEngCfg.Exe", 1)
  113. End Sub
  114.  
  115. Sub PdoxInter_Click ()
  116.     Dim handle%
  117.     handle% = Shell("Paradox.Pif", 3)
  118. End Sub
  119.  
  120. Sub myWin_Click (Index As Integer)
  121.     Select Case Index
  122.         Case 1
  123.             Form1.SetFocus
  124.         Case 2
  125.             Form2.SetFocus
  126. '        Case 3
  127. '            Form3.SetFocus
  128. '        Case 4
  129. '            Form4.SetFocus
  130. '        Case 5
  131. '            Form5.SetFocus
  132.     End Select
  133. End Sub
  134.  
  135. Sub Timer1_Timer ()
  136.     If (AlarmTime! < Timer And DidRing% = FALSE) Then
  137.         mhAlarm1.Visible = TRUE
  138.         mhAlarm1.Ringon = 2
  139.     End If
  140.  
  141. End Sub
  142.  
  143. Sub MhAlarm1_Click ()
  144.     Timer2.Enabled = TRUE
  145.     Timer1.Enabled = FALSE
  146. '    AlarmTime! = Timer + 10
  147. '    mhAlarm1.Ringon = 0
  148. '    mhAlarm1.Visible = FALSE
  149.     
  150. End Sub
  151.  
  152. Function pdoxExit% ()
  153.     pxerr% = pxExit%()
  154.     If pxerr% <> PXSUCCESS% Then
  155.         pdoxExit% = FALSE%
  156.     Else
  157.         pdoxExit% = TRUE%
  158.     End If
  159.  
  160. End Function
  161.  
  162. Sub ClearFldForm ()
  163.     Do While form1d.sourceflds.listcount
  164.         form1d.sourceflds.RemoveItem 0
  165.     Loop
  166.     Do While form1d.displayflds.listcount
  167.         form1d.displayflds.RemoveItem 0
  168.     Loop
  169. End Sub
  170.  
  171. Sub Timer2_Timer ()
  172.     DidRing% = FALSE
  173.     AlarmTime! = Timer + 10
  174.     mhAlarm1.Ringon = 0
  175.     mhAlarm1.Visible = FALSE%
  176.     Timer2.Enabled = FALSE
  177.     Timer1.Enabled = TRUE
  178. End Sub
  179.  
  180. Sub MhAlarm1_DblClick ()
  181.     DidRing% = TRUE
  182.     Timer1.Enabled = FALSE
  183.     Timer2.Enabled = FALSE
  184.     mhAlarm1.Visible = FALSE
  185.     mhAlarm1.Ringon = 0
  186. End Sub
  187.  
  188.